package com.goldmantis.alitrip.pojo;

import com.goldmantis.alitrip.common.annotation.Display;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.*;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import java.util.List;

/**
 * @author chenjd
 */
@Table(name = "sys_data_privileges")
@ApiModel("sys_data_privileges")
public class SysDataPrivileges {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Max(value=2147483647,message="最大值不能高于{value}")
    @Min(value=-2147483648,message="最小值不能低于{value}")
    private Integer id;

    /**
     * 用户ID
     */
    @Display("用户ID")
    @ApiModelProperty("用户ID")
    private Long userid;

    /**
     * 资源主键
     */
    @Display("资源主键")
    @ApiModelProperty("资源主键")
    private Long depid;

    /**
     * 模块ID
     */
    @Display("模块ID")
    @ApiModelProperty("模块ID")
    private Long moduleid;

    /**
     * @return id
     */
    public Integer getId() {
        return id;
    }

    /**
     * @param id
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * 获取用户ID
     *
     * @return userid - 用户ID
     */
    public Long getUserid() {
        return userid;
    }

    /**
     * 设置用户ID
     *
     * @param userid 用户ID
     */
    public void setUserid(Long userid) {
        this.userid = userid;
    }

    /**
     * 获取资源主键
     *
     * @return depid - 资源主键
     */
    public Long getDepid() {
        return depid;
    }

    /**
     * 设置资源主键
     *
     * @param depid 资源主键
     */
    public void setDepid(Long depid) {
        this.depid = depid;
    }

    /**
     * 获取模块ID
     *
     * @return moduleid - 模块ID
     */
    public Long getModuleid() {
        return moduleid;
    }

    /**
     * 设置模块ID
     *
     * @param moduleid 模块ID
     */
    public void setModuleid(Long moduleid) {
        this.moduleid = moduleid;
    }

    @ApiModelProperty("客户端批量添加部门时用到")
    @Transient
    @Display("批量添加部门")
    private List<Long> deptIds;

    public List<Long> getDeptIds() {
        return deptIds;
    }

    public void setDeptIds(List<Long> deptIds) {
        this.deptIds = deptIds;
    }


    @Override
    public String toString() {
        return "SysDataPrivileges{" +
                "id=" + id +
                ", userid=" + userid +
                ", depid=" + depid +
                ", moduleid=" + moduleid +
                ", deptIds=" + deptIds +
                '}';
    }
}